package com.grad.why.studentsystem.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.grad.why.studentsystem.domain.Camera;
import com.grad.why.studentsystem.domain.Runtimecoursearrangeinfo;
import com.grad.why.studentsystem.mapper.CameraMapper;
import com.grad.why.studentsystem.mapper.RuntimecoursearrangeinfoMapper;
import com.grad.why.studentsystem.service.RuntimeCourseArrangeInfoRecordService;
import com.grad.why.studentsystem.service.RuntimecoursearrangeinfoService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;


import java.util.List;

@Component
@Service(interfaceClass = RuntimecoursearrangeinfoService.class)
@Transactional
public class RuntimecoursearrangeinfoServiceImpl implements RuntimecoursearrangeinfoService {
    @Autowired
    private RuntimecoursearrangeinfoMapper runtimecoursearrangeinfoMapper;

    @Autowired
    private CameraMapper cameraMapper;

    @Override
    public List<Runtimecoursearrangeinfo> getAllRuntimeCourseInfos() {
        try{
            return runtimecoursearrangeinfoMapper.getAllRuntimeCourseInfos();
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public List<Camera> getCamerasByClassRoomId(Integer classroomid) {
        try{
            return cameraMapper.getCameraInfosByClassroomId(classroomid);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
